
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class REPAIR_ORDER_FAULTMap : EntityTypeConfiguration<REPAIR_ORDER_FAULT>
    {
        public REPAIR_ORDER_FAULTMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            // Table & Column Mappings
            this.ToTable("REPAIR_ORDER_FAULT");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.REPAIR_ORDER_ID).HasColumnName("REPAIR_ORDER_ID");
            this.Property(t => t.FAULT_TYPE).HasColumnName("FAULT_TYPE");
            this.Property(t => t.REMARK).HasColumnName("REMARK");

            // Relationships
            this.HasRequired(t => t.REPAIR_ORDERS)
                .WithMany(t => t.REPAIR_ORDER_FAULT)
                .HasForeignKey(d => d.REPAIR_ORDER_ID);

        }
    }
}
